import DefaultTheme from "vitepress/theme";
import { h } from 'vue'
import Documate from '@documate/vue'

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import "./custom.css";
export default {
  ...DefaultTheme,
  NotFound: () => "404", // <- this is a Vue 3 functional component
  enhanceApp({ app, router, siteData }) {
    // app is the Vue 3 app instance from createApp()
    // router is VitePress' custom router (see `lib/app/router.js`)
    // siteData is a ref of current site-level metadata.
    app.use(ElementPlus);
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
  Layout: () => {
    return h(DefaultTheme.Layout, null, {
      'nav-bar-content-before': () => h(Documate, {
        //请求地址endpoint:https://xqtb17uycg.us.aircode.run/ask 
        // 请求api：知识检索/retrieve/stream流式和/retrieve/invoke和接入AI回答/chat/invoke
        endpoint: 'http://172.16.90.250:8000/chat/invoke', 
        predefinedQuestions: [
          // 'What is Documate?',
          '机器学习是什么？',
          '大数据是什么？',
          '人工智能是什么？'
        ],
      }),
    })
  },
};
